﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LeMigue.Scrum.Iterface.Model;
using LeMigue.Scrum.Iterface.Enum;

namespace LeMigue.TeamPortal.Dev.Cenarios
{
    public class DevDados
    {

        private static IList<Team> _team;
        public static IList<Team> Team
        {
            get
            {
                if (_team == null)
                {
                    _team = new List<Team>();

                    Team team;
                    team = new Team(1, "Time 01");
                    _team.Add(team);
                    team = new Team(2, "Time 02");
                    _team.Add(team);

                }

                return _team;
            }
        }

        private static IList<User> _users;
        public static IList<User> Users
        {
            get{

                if(_users == null){
                    _users = new List<User>();

                    User user;

                    user = new User("Usuario", "usuario");
                    _users.Add(user);
                    user = new User("Administrador", "adm");
                    _users.Add(user);
                }

                return _users;
            }
        }

        private static IList<Project> _projects;
        public static IList<Project> Projects
        {
            get
            {
                if (_projects == null)
                {
                    _projects = new List<Project>();

                    Project project;

                    project = new Project(1, "Projeto 01");
                    _projects.Add(project);

                    project = new Project(2, "Projeto 02");
                    _projects.Add(project);

                }

                return _projects;
            }
        }

        private static IList<Iteration> _iteration;
        public static IList<Iteration> Iteration
        {
            get
            {
                if (_iteration == null)
                {
                    _iteration = new List<Iteration>();

                    Iteration interation;

                    interation = new Iteration(1, "Interação 01");
                    _iteration.Add(interation);

                    interation = new Iteration(2, "Interação 02");
                    _iteration.Add(interation);

                    interation = new Iteration(3, "Interação 03");
                    _iteration.Add(interation);

                    interation = new Iteration(4, "Interação 04");
                    _iteration.Add(interation);

                    interation = new Iteration(5, "Interação 05");
                    _iteration.Add(interation);
                }
                return _iteration;
            }
        }
        private static IList<Sprint> _sprints;
        public static IList<Sprint> Sprint{
            get
            {
                if (_sprints == null)
                {
                    _sprints = new List<Sprint>();

                    Sprint sprint;

                    sprint = new Sprint(1, "Sprint 01")
                    {
                        Start = DateTime.Now.AddDays(-5),
                        End = DateTime.Now.AddDays(5)
                    };
                    _sprints.Add(sprint);

                    sprint = new Sprint(2, "Sprint 02")
                    {
                        Start = DateTime.Now.AddDays(6),
                        End = DateTime.Now.AddDays(15)
                    };
                    _sprints.Add(sprint);
                }
                return _sprints;
            }
        }

        private static IList<ItemBacklog> _backlog;
        public static IList<ItemBacklog> Backlog
        {
            get
            {
                if (_backlog == null)
                {
                    _backlog = new List<ItemBacklog>();

                    ItemBacklog item;
                    
                    item = new ItemBacklog(1, "Backlog 01");
                    _backlog.Add(item);
                    item = new ItemBacklog(2, "Backlog 02");
                    _backlog.Add(item);
                    item = new ItemBacklog(3, "Backlog 03");
                    _backlog.Add(item);
                    item = new ItemBacklog(4, "Backlog 04");
                    _backlog.Add(item);
                    item = new ItemBacklog(5, "Backlog 05");
                    _backlog.Add(item);

                }

                return _backlog;
            }
        }
        private static IList<Bug> _bugs;
        public static IList<Bug> Bugs
        {
            get
            {
                if (_bugs == null)
                {
                    _bugs = new List<Bug>();

                    Bug bug;
                    bug = new Bug(1, "Bug 01");
                    _bugs.Add(bug);
                    bug = new Bug(2, "Bug 02");
                    _bugs.Add(bug);
                    bug = new Bug(3, "Bug 03");
                    _bugs.Add(bug);
                }

                return _bugs;
            }
        }
        private static IList<Task> _tasks;
        public static IList<Task> Tasks
        {
            get
            {
                if (_tasks == null)
                {
                    _tasks = new List<Task>();

                    Task task;

                    task = new Task(1, "Tarefa 01"){ State = TaskState.ToDo };
                    _tasks.Add(task);
                    task = new Task(2, "Tarefa 02"){ State = TaskState.ToDo };
                    _tasks.Add(task);
                    task = new Task(3, "Tarefa 03"){ State = TaskState.ToDo };
                    _tasks.Add(task);
                    task = new Task(4, "Tarefa 04") { State = TaskState.ToDo };
                    _tasks.Add(task);
                    task = new Task(5, "Tarefa 05") { State = TaskState.ToDo };
                    _tasks.Add(task);
                    task = new Task(6, "Tarefa 06") { State = TaskState.ToDo };
                    _tasks.Add(task);
                    task = new Task(7, "Tarefa 07") { State = TaskState.ToDo };
                    _tasks.Add(task);
                    task = new Task(8, "Tarefa 08") { State = TaskState.ToDo };
                    _tasks.Add(task);
                    task = new Task(9, "Tarefa 09") { State = TaskState.ToDo };
                    _tasks.Add(task);
                    task = new Task(10, "Tarefa 10") { State = TaskState.ToDo };
                    _tasks.Add(task);
                }

                return _tasks;
            }
        }
    }
}
